<%--
  Created by IntelliJ IDEA.
  User: LT
  Date: 2018-10-25
  Time: 15:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link href="${pageContext.request.contextPath}/statics/hplus/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/statics/hplus/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/statics/hplus/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/hplus/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/hplus/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/hplus/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script>
        function searcha() {
            var opts = $("#usertb").bootstrapTable("getOptions") ;
            var limit = opts.pageSize ;
            var offset = (opts.pageNumber-1) * limit;
            var username = $("#username").val() ;
            $.post("${pageContext.request.contextPath}/huiyuan/fenyemohchax1",{'username':username,'limit':limit,'offset':offset},function (data) {
                // var mydata = eval("("+data+")") ;
                //重新绑定表格数据
                $("#usertb").bootstrapTable('load',data) ;
            })
        }

        $(function () {
            $("#usertb").bootstrapTable({
                url:'${pageContext.request.contextPath}/huiyuan/fenyemohchax1',
                //设置每页多少条数据
                pageSize:2,
                pageList:[2,4,8,16],
                height:300,
                pageNumber:1,
                //启用分页，但是默认情况下，是客户端分页的
                pagination:true,
                //启用服务器端分页
                sidePagination:'server',
                queryParams:function(params){
                    var temp = {  //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                        limit: params.limit,  //页面大小
                        offset: params.offset, //页码
                        username:$("#username").val()
                    };
                    return temp;
                },
                columns:[
                    {
                     field:'huiyuan_Id',
                     title:'会员编号'
                 },
                     {
                       field:'huiyuan_Name',
                      title:'会员姓名'
                    },
            {
                field:'huiyuan_Kahao',
                    title:'会员卡号'
            },
            {
                field:'huiyuanleixing_Name',
                    title:'会员类型'
            },
            {
                field:'huiyuan_Xingbie',
                    title:'性别'
            },
            {
                field:'phone',
                    title:'联系电话'
            },
            {
                field:'kanei_JinE',
                    title:'卡内余额'
            },
            {
                field:'dianpu_Name',
                    title:'开卡店铺'
            },
            {
                field:'banliren',
                    title:'经办人'
            },
            {
                    field:'zhuangtai',
                    title:'状态',
                formatter:function (a,b,c) {
                    if (b.zhuangtai==1){
                        return "启用" ;
                    }
                    else{
                        return "禁用" ;
                    }
                }
            },
            {
                title:'操作',
                formatter:function (value,row,index) {
                    return "<button class='btn  btn-primary' onclick='xiangqing'>详情</button> &nbsp;"+
                        "<button class='btn btn-primary' onclick='xgai'>编辑</button> &nbsp;"+
                    "<button class='btn btn-primary' onclick='jifen'>积分</button>"

                }
            },
                ]
            }) ;
        }) ;
    </script>

</head>
<body>

<div class="panel panel-default">
    <div class="panel-body">
        <div class="row">
            <div class="col-sm-6">
                <form  class="form-inline">
                    <input id="username" type="text" placeholder="会员姓名 " class="form-control">
                    <button class="btn btn-primary" onclick="searcha()" type="button"><span class="glyphicon glyphicon-search"></span>&nbsp;&nbsp;搜索</button>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <table id="usertb"></table>
            </div>
        </div>

    </div>
</div>
<!--增加模板-->
<div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                </button>
                <i class="fa fa-laptop modal-icon"></i>
                <h4 class="modal-title">增加会员</h4>
            </div>
            <form method="post" class="form-horizontal" id="fm">
                <div class="modal-body">
                    <div class="ibox-content">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员编号</label>
                            <div class="col-sm-10">
                                <input  name="demandid" type="text" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员姓名</label>
                            <div class="col-sm-10">
                                <input name="houseaddress" type="text" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员类型</label>
                            <div class="col-sm-10">
                                <select name="customerid" class="form-control">

                                </select>
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员性别</label>
                            <div class="col-sm-10">
                                <input name="acreagemin" type="number" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">联系电话</label>
                            <div class="col-sm-10">
                                <input type="number" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">户型</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">层数</label>
                            <div class="col-sm-10">
                                <input type="number" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">共有层数</label>
                            <div class="col-sm-10">
                                <input type="number" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">价格</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" data-mask="&yen; 999,999,999.99" placeholder="">
                                <span class="help-block">&yen; 999,999,999.99</span>
                            </div>
                        </div>



                        <div class="form-group">
                            <label class="col-sm-2 control-label">装修类型</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">配套设施</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">跟踪人</label>
                            <div class="col-sm-10">
                                <select name="userid" class="form-control">

                                </select>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-primary">保存</button>
                </div>
            </form>
        </div>
    </div>
</div>

</div>

</div>

</body>
</html>
